/**
 * Created by ZZM on 2018/1/24.
 */
$(function () {
    $(".login button").on("tap",function () {
        var userName=$(".userName input").val()
        var passWord=$(".passWord input").val()
        if(userName.length<6){
            mui.toast("用户名不合法");
            return;
        };
        if(passWord.length<6){
            mui.toast("密码不合法");
            return;
        };
        var Suju={
            username:userName,
            password:passWord
        }
        $.post("/user/login",Suju,function (result) {
            if(result.error==403){
                mui.toast(result.message);
            }else {
                var returnURL=$.getQueryString("returnURL");
                if(returnURL){
                    location.href=returnURL;
                }else{
                    location.href="../index.html";
                }
            }
        })
    })
})